package utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LoggerUtile {

    static Logger logger;
    static LoggerUtile loggerUtile;
    static String args1;

    public static LoggerUtile getLogger(String args2) {
        args1 = args2;
        logger = LoggerFactory.getLogger(args2);
        return loggerUtile;
    }

    public static void info(Object... o){
        StringBuilder sb = new StringBuilder();
        for (Object o1 : o) {
            sb.append(o1+" - ");
        }
        System.out.println(sb.substring(0,sb.length()-3));
        logger.info(args1+" - "+sb.substring(0,sb.length()-3));
    }

    public static void error(Object... o){
        StringBuilder sb = new StringBuilder();
        for (Object o1 : o) {
            sb.append(o1+" - ");
        }
        logger.error(args1+" - "+sb.substring(0,sb.length()-3));
    }



}
